3.5 \(\int \frac{d+e x+f x^2+g x^3}{a+b x^n+c x^{2 n}} \, dx\)

Optimal. Leaf size=545 \[ -\frac{2 c d x \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};-\frac{2 c x^n}{b-\sqrt{b^2-4 a c}}\right )}{-b \sqrt{b^2-4 a c}-4 a c+b^2}-\frac{2 c d x \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{b \sqrt{b^2-4 a c}-4 a c+b^2}-\frac{c e x^2 \, _2F_1\left (1,\frac{2}{n};\frac{n+2}{n};-\frac{2 c x^n}{b-\sqrt{b^2-4 a c}}\right )}{-b \sqrt{b^2-4 a c}-4 a c+b^2}-\frac{c e x^2 \, _2F_1\left (1,\frac{2}{n};\frac{n+2}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{b \sqrt{b^2-4 a c}-4 a c+b^2}-\frac{2 c f x^3 \, _2F_1\left (1,\frac{3}{n};\frac{n+3}{n};-\frac{2 c x^n}{b-\sqrt{b^2-4 a c}}\right )}{3 \left (-b \sqrt{b^2-4 a c}-4 a c+b^2\right )}-\frac{2 c f x^3 \, _2F_1\left (1,\frac{3}{n};\frac{n+3}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{3 \left (b \sqrt{b^2-4 a c}-4 a c+b^2\right )}-\frac{c g x^4 \, _2F_1\left (1,\frac{4}{n};\frac{n+4}{n};-\frac{2 c x^n}{b-\sqrt{b^2-4 a c}}\right )}{2 \left (-b \sqrt{b^2-4 a c}-4 a c+b^2\right )}-\frac{c g x^4 \, _2F_1\left (1,\frac{4}{n};\frac{n+4}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{2 \left (b \sqrt{b^2-4 a c}-4 a c+b^2\right )} \]

[Out]

(-2*c*d*x*Hypergeometric2F1[1, n^(-1), 1 + n^(-1), (-2*c*x^n)/(b - Sqrt[b^2 - 4*a*c])])/(b^2 - 4*a*c - b*Sqrt[
b^2 - 4*a*c]) - (2*c*d*x*Hypergeometric2F1[1, n^(-1), 1 + n^(-1), (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c])])/(b^2 -
4*a*c + b*Sqrt[b^2 - 4*a*c]) - (c*e*x^2*Hypergeometric2F1[1, 2/n, (2 + n)/n, (-2*c*x^n)/(b - Sqrt[b^2 - 4*a*c]
)])/(b^2 - 4*a*c - b*Sqrt[b^2 - 4*a*c]) - (c*e*x^2*Hypergeometric2F1[1, 2/n, (2 + n)/n, (-2*c*x^n)/(b + Sqrt[b
^2 - 4*a*c])])/(b^2 - 4*a*c + b*Sqrt[b^2 - 4*a*c]) - (2*c*f*x^3*Hypergeometric2F1[1, 3/n, (3 + n)/n, (-2*c*x^n
)/(b - Sqrt[b^2 - 4*a*c])])/(3*(b^2 - 4*a*c - b*Sqrt[b^2 - 4*a*c])) - (2*c*f*x^3*Hypergeometric2F1[1, 3/n, (3
+ n)/n, (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c])])/(3*(b^2 - 4*a*c + b*Sqrt[b^2 - 4*a*c])) - (c*g*x^4*Hypergeometric
2F1[1, 4/n, (4 + n)/n, (-2*c*x^n)/(b - Sqrt[b^2 - 4*a*c])])/(2*(b^2 - 4*a*c - b*Sqrt[b^2 - 4*a*c])) - (c*g*x^4
*Hypergeometric2F1[1, 4/n, (4 + n)/n, (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c])])/(2*(b^2 - 4*a*c + b*Sqrt[b^2 - 4*a*
c]))

________________________________________________________________________________________

Rubi [A]  time = 0.351151, antiderivative size = 545, normalized size of antiderivative = 1., number of steps used = 13, number of rules used = 4, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {1793, 1893, 245, 364} \[ -\frac{2 c d x \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};-\frac{2 c x^n}{b-\sqrt{b^2-4 a c}}\right )}{-b \sqrt{b^2-4 a c}-4 a c+b^2}-\frac{2 c d x \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{b \sqrt{b^2-4 a c}-4 a c+b^2}-\frac{c e x^2 \, _2F_1\left (1,\frac{2}{n};\frac{n+2}{n};-\frac{2 c x^n}{b-\sqrt{b^2-4 a c}}\right )}{-b \sqrt{b^2-4 a c}-4 a c+b^2}-\frac{c e x^2 \, _2F_1\left (1,\frac{2}{n};\frac{n+2}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{b \sqrt{b^2-4 a c}-4 a c+b^2}-\frac{2 c f x^3 \, _2F_1\left (1,\frac{3}{n};\frac{n+3}{n};-\frac{2 c x^n}{b-\sqrt{b^2-4 a c}}\right )}{3 \left (-b \sqrt{b^2-4 a c}-4 a c+b^2\right )}-\frac{2 c f x^3 \, _2F_1\left (1,\frac{3}{n};\frac{n+3}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{3 \left (b \sqrt{b^2-4 a c}-4 a c+b^2\right )}-\frac{c g x^4 \, _2F_1\left (1,\frac{4}{n};\frac{n+4}{n};-\frac{2 c x^n}{b-\sqrt{b^2-4 a c}}\right )}{2 \left (-b \sqrt{b^2-4 a c}-4 a c+b^2\right )}-\frac{c g x^4 \, _2F_1\left (1,\frac{4}{n};\frac{n+4}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{2 \left (b \sqrt{b^2-4 a c}-4 a c+b^2\right )} \]

Antiderivative was successfully verified.

[In]

Int[(d + e*x + f*x^2 + g*x^3)/(a + b*x^n + c*x^(2*n)),x]

[Out]

(-2*c*d*x*Hypergeometric2F1[1, n^(-1), 1 + n^(-1), (-2*c*x^n)/(b - Sqrt[b^2 - 4*a*c])])/(b^2 - 4*a*c - b*Sqrt[
b^2 - 4*a*c]) - (2*c*d*x*Hypergeometric2F1[1, n^(-1), 1 + n^(-1), (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c])])/(b^2 -
4*a*c + b*Sqrt[b^2 - 4*a*c]) - (c*e*x^2*Hypergeometric2F1[1, 2/n, (2 + n)/n, (-2*c*x^n)/(b - Sqrt[b^2 - 4*a*c]
)])/(b^2 - 4*a*c - b*Sqrt[b^2 - 4*a*c]) - (c*e*x^2*Hypergeometric2F1[1, 2/n, (2 + n)/n, (-2*c*x^n)/(b + Sqrt[b
^2 - 4*a*c])])/(b^2 - 4*a*c + b*Sqrt[b^2 - 4*a*c]) - (2*c*f*x^3*Hypergeometric2F1[1, 3/n, (3 + n)/n, (-2*c*x^n
)/(b - Sqrt[b^2 - 4*a*c])])/(3*(b^2 - 4*a*c - b*Sqrt[b^2 - 4*a*c])) - (2*c*f*x^3*Hypergeometric2F1[1, 3/n, (3
+ n)/n, (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c])])/(3*(b^2 - 4*a*c + b*Sqrt[b^2 - 4*a*c])) - (c*g*x^4*Hypergeometric
2F1[1, 4/n, (4 + n)/n, (-2*c*x^n)/(b - Sqrt[b^2 - 4*a*c])])/(2*(b^2 - 4*a*c - b*Sqrt[b^2 - 4*a*c])) - (c*g*x^4
*Hypergeometric2F1[1, 4/n, (4 + n)/n, (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c])])/(2*(b^2 - 4*a*c + b*Sqrt[b^2 - 4*a*
c]))

Rule 1793

Int[(Pq_)/((a_) + (b_.)*(x_)^(n_.) + (c_.)*(x_)^(n2_.)), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[(2*c
)/q, Int[Pq/(b - q + 2*c*x^n), x], x] - Dist[(2*c)/q, Int[Pq/(b + q + 2*c*x^n), x], x]] /; FreeQ[{a, b, c, n},
 x] && EqQ[n2, 2*n] && PolyQ[Pq, x] && NeQ[b^2 - 4*a*c, 0]

Rule 1893

Int[(Pq_)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, n, p}, x] && (PolyQ[Pq, x] || PolyQ[Pq, x^n])

Rule 245

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*x*Hypergeometric2F1[-p, 1/n, 1/n + 1, -((b*x^n)/a)],
x] /; FreeQ[{a, b, n, p}, x] &&  !IGtQ[p, 0] &&  !IntegerQ[1/n] &&  !ILtQ[Simplify[1/n + p], 0] && (IntegerQ[p
] || GtQ[a, 0])

Rule 364

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(a^p*(c*x)^(m + 1)*Hypergeometric2F1[-
p, (m + 1)/n, (m + 1)/n + 1, -((b*x^n)/a)])/(c*(m + 1)), x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] &&
 (ILtQ[p, 0] || GtQ[a, 0])

Rubi steps

\begin{align*} \int \frac{d+e x+f x^2+g x^3}{a+b x^n+c x^{2 n}} \, dx &=\frac{(2 c) \int \frac{d+e x+f x^2+g x^3}{b-\sqrt{b^2-4 a c}+2 c x^n} \, dx}{\sqrt{b^2-4 a c}}-\frac{(2 c) \int \frac{d+e x+f x^2+g x^3}{b+\sqrt{b^2-4 a c}+2 c x^n} \, dx}{\sqrt{b^2-4 a c}}\\ &=\frac{(2 c) \int \left (-\frac{d}{-b+\sqrt{b^2-4 a c}-2 c x^n}-\frac{e x}{-b+\sqrt{b^2-4 a c}-2 c x^n}-\frac{f x^2}{-b+\sqrt{b^2-4 a c}-2 c x^n}-\frac{g x^3}{-b+\sqrt{b^2-4 a c}-2 c x^n}\right ) \, dx}{\sqrt{b^2-4 a c}}-\frac{(2 c) \int \left (\frac{d}{b+\sqrt{b^2-4 a c}+2 c x^n}+\frac{e x}{b+\sqrt{b^2-4 a c}+2 c x^n}+\frac{f x^2}{b+\sqrt{b^2-4 a c}+2 c x^n}+\frac{g x^3}{b+\sqrt{b^2-4 a c}+2 c x^n}\right ) \, dx}{\sqrt{b^2-4 a c}}\\ &=-\frac{(2 c d) \int \frac{1}{-b+\sqrt{b^2-4 a c}-2 c x^n} \, dx}{\sqrt{b^2-4 a c}}-\frac{(2 c d) \int \frac{1}{b+\sqrt{b^2-4 a c}+2 c x^n} \, dx}{\sqrt{b^2-4 a c}}-\frac{(2 c e) \int \frac{x}{-b+\sqrt{b^2-4 a c}-2 c x^n} \, dx}{\sqrt{b^2-4 a c}}-\frac{(2 c e) \int \frac{x}{b+\sqrt{b^2-4 a c}+2 c x^n} \, dx}{\sqrt{b^2-4 a c}}-\frac{(2 c f) \int \frac{x^2}{-b+\sqrt{b^2-4 a c}-2 c x^n} \, dx}{\sqrt{b^2-4 a c}}-\frac{(2 c f) \int \frac{x^2}{b+\sqrt{b^2-4 a c}+2 c x^n} \, dx}{\sqrt{b^2-4 a c}}-\frac{(2 c g) \int \frac{x^3}{-b+\sqrt{b^2-4 a c}-2 c x^n} \, dx}{\sqrt{b^2-4 a c}}-\frac{(2 c g) \int \frac{x^3}{b+\sqrt{b^2-4 a c}+2 c x^n} \, dx}{\sqrt{b^2-4 a c}}\\ &=-\frac{2 c d x \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};-\frac{2 c x^n}{b-\sqrt{b^2-4 a c}}\right )}{b^2-4 a c-b \sqrt{b^2-4 a c}}-\frac{2 c d x \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{b^2-4 a c+b \sqrt{b^2-4 a c}}-\frac{c e x^2 \, _2F_1\left (1,\frac{2}{n};\frac{2+n}{n};-\frac{2 c x^n}{b-\sqrt{b^2-4 a c}}\right )}{b^2-4 a c-b \sqrt{b^2-4 a c}}-\frac{c e x^2 \, _2F_1\left (1,\frac{2}{n};\frac{2+n}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{b^2-4 a c+b \sqrt{b^2-4 a c}}-\frac{2 c f x^3 \, _2F_1\left (1,\frac{3}{n};\frac{3+n}{n};-\frac{2 c x^n}{b-\sqrt{b^2-4 a c}}\right )}{3 \left (b^2-4 a c-b \sqrt{b^2-4 a c}\right )}-\frac{2 c f x^3 \, _2F_1\left (1,\frac{3}{n};\frac{3+n}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{3 \left (b^2-4 a c+b \sqrt{b^2-4 a c}\right )}-\frac{c g x^4 \, _2F_1\left (1,\frac{4}{n};\frac{4+n}{n};-\frac{2 c x^n}{b-\sqrt{b^2-4 a c}}\right )}{2 \left (b^2-4 a c-b \sqrt{b^2-4 a c}\right )}-\frac{c g x^4 \, _2F_1\left (1,\frac{4}{n};\frac{4+n}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )}{2 \left (b^2-4 a c+b \sqrt{b^2-4 a c}\right )}\\ \end{align*}

Mathematica [A]  time = 0.566578, size = 460, normalized size = 0.84 \[ \frac{x \left (12 d \left (\sqrt{b^2-4 a c}+b\right ) \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};\frac{2 c x^n}{\sqrt{b^2-4 a c}-b}\right )+12 d \left (\sqrt{b^2-4 a c}-b\right ) \, _2F_1\left (1,\frac{1}{n};1+\frac{1}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )+x \left (6 e \left (\sqrt{b^2-4 a c}+b\right ) \, _2F_1\left (1,\frac{2}{n};\frac{n+2}{n};\frac{2 c x^n}{\sqrt{b^2-4 a c}-b}\right )+6 e \left (\sqrt{b^2-4 a c}-b\right ) \, _2F_1\left (1,\frac{2}{n};\frac{n+2}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )+x \left (4 f \left (\sqrt{b^2-4 a c}+b\right ) \, _2F_1\left (1,\frac{3}{n};\frac{n+3}{n};\frac{2 c x^n}{\sqrt{b^2-4 a c}-b}\right )+4 f \left (\sqrt{b^2-4 a c}-b\right ) \, _2F_1\left (1,\frac{3}{n};\frac{n+3}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )+3 g x \left (\left (\sqrt{b^2-4 a c}+b\right ) \, _2F_1\left (1,\frac{4}{n};\frac{n+4}{n};\frac{2 c x^n}{\sqrt{b^2-4 a c}-b}\right )+\left (\sqrt{b^2-4 a c}-b\right ) \, _2F_1\left (1,\frac{4}{n};\frac{n+4}{n};-\frac{2 c x^n}{b+\sqrt{b^2-4 a c}}\right )\right )\right )\right )\right )}{24 a \sqrt{b^2-4 a c}} \]

Antiderivative was successfully verified.

[In]

Integrate[(d + e*x + f*x^2 + g*x^3)/(a + b*x^n + c*x^(2*n)),x]

[Out]

(x*(12*(b + Sqrt[b^2 - 4*a*c])*d*Hypergeometric2F1[1, n^(-1), 1 + n^(-1), (2*c*x^n)/(-b + Sqrt[b^2 - 4*a*c])]
+ 12*(-b + Sqrt[b^2 - 4*a*c])*d*Hypergeometric2F1[1, n^(-1), 1 + n^(-1), (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c])] +
 x*(6*(b + Sqrt[b^2 - 4*a*c])*e*Hypergeometric2F1[1, 2/n, (2 + n)/n, (2*c*x^n)/(-b + Sqrt[b^2 - 4*a*c])] + 6*(
-b + Sqrt[b^2 - 4*a*c])*e*Hypergeometric2F1[1, 2/n, (2 + n)/n, (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c])] + x*(4*(b +
 Sqrt[b^2 - 4*a*c])*f*Hypergeometric2F1[1, 3/n, (3 + n)/n, (2*c*x^n)/(-b + Sqrt[b^2 - 4*a*c])] + 4*(-b + Sqrt[
b^2 - 4*a*c])*f*Hypergeometric2F1[1, 3/n, (3 + n)/n, (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c])] + 3*g*x*((b + Sqrt[b^
2 - 4*a*c])*Hypergeometric2F1[1, 4/n, (4 + n)/n, (2*c*x^n)/(-b + Sqrt[b^2 - 4*a*c])] + (-b + Sqrt[b^2 - 4*a*c]
)*Hypergeometric2F1[1, 4/n, (4 + n)/n, (-2*c*x^n)/(b + Sqrt[b^2 - 4*a*c])])))))/(24*a*Sqrt[b^2 - 4*a*c])

________________________________________________________________________________________

Maple [F]  time = 0.031, size = 0, normalized size = 0. \begin{align*} \int{\frac{g{x}^{3}+f{x}^{2}+ex+d}{a+b{x}^{n}+c{x}^{2\,n}}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g*x^3+f*x^2+e*x+d)/(a+b*x^n+c*x^(2*n)),x)

[Out]

int((g*x^3+f*x^2+e*x+d)/(a+b*x^n+c*x^(2*n)),x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{g x^{3} + f x^{2} + e x + d}{c x^{2 \, n} + b x^{n} + a}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x^3+f*x^2+e*x+d)/(a+b*x^n+c*x^(2*n)),x, algorithm="maxima")

[Out]

integrate((g*x^3 + f*x^2 + e*x + d)/(c*x^(2*n) + b*x^n + a), x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{g x^{3} + f x^{2} + e x + d}{c x^{2 \, n} + b x^{n} + a}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x^3+f*x^2+e*x+d)/(a+b*x^n+c*x^(2*n)),x, algorithm="fricas")

[Out]

integral((g*x^3 + f*x^2 + e*x + d)/(c*x^(2*n) + b*x^n + a), x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x**3+f*x**2+e*x+d)/(a+b*x**n+c*x**(2*n)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{g x^{3} + f x^{2} + e x + d}{c x^{2 \, n} + b x^{n} + a}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x^3+f*x^2+e*x+d)/(a+b*x^n+c*x^(2*n)),x, algorithm="giac")

[Out]

integrate((g*x^3 + f*x^2 + e*x + d)/(c*x^(2*n) + b*x^n + a), x)